<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include.inc.jsp"%>
<div class="pageContent">
	<form method="post" action='<c:url value="/system/user/authorize"/>' class="pageForm required-validate" onsubmit="return validateCallback(this , dialogAjaxDone)">
	<input type="hidden" value="${param.userId }" name="userId">
		<div class="pageFormContent" layoutH="57">
			<ul class="tree treeFolder treeCheck expand" oncheck="checkOrg" >
				<c:forEach items="${orgs }" var="org">
					<c:set scope="request" value="${org }" var="org"></c:set>
					<c:import url="authorizedOrgTree.jsp"></c:import>
				</c:forEach>
			</ul>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div> 
		<input type="hidden" name="callbackType" value="closeCurrent"> 
		<input type="hidden" name="navTabId" value="tab_system_user_list"> 
		<input type="hidden" name="rel" value="dialog_system_user_authorize"> 
	</form>
</div>
<script>
function checkOrg(data){
	if($.type(data.items) != 'array'){
		if(data.checked){
			$("input[name='" + data.items.name +"'][value='" + data.items.value + "']").attr("checked","checked");
		}else{
			$("input[name='" + data.items.name +"'][value='" + data.items.value + "']").attr("checked","");
		}
	}	
}
</script>